home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / gnuplot / contrib / clark / eepic.patch < prev   
Internet Message Format  |  1992-02-11  |  7KB

  1. From pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu Mon Jan 20 12:00:35 1992
  2. Return-Path: <pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu>
  3. Received: from ames.arc.nasa.gov by ra-next.arc.nasa.gov (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
  4.     id AA01551; Mon, 20 Jan 92 12:00:31 PST
  5. Received: from ucbvax.Berkeley.EDU by ames.arc.nasa.gov (5.65c/1.21)
  6.     with SMTP id AA27517 for <woo@ames.arc.nasa.gov>
  7.     on Mon, 20 Jan 1992 07:14:46 -0800
  8. Received: from pixar.UUCP by ucbvax.Berkeley.EDU (5.63/1.43)
  9.     id AA11844; Mon, 20 Jan 92 11:31:40 -0800
  10. Received: from sun.UUCP by pixar (4.1/SMI-4.1)
  11.     id AA07639; Sat, 18 Jan 92 12:14:59 PST
  12. Received: from Sun.COM (sun-barr) by sun.Eng.Sun.COM (4.1/SMI-4.1)
  13.     id AA12923; Sat, 18 Jan 92 11:52:36 PST
  14. Received: from boulder.Colorado.EDU by Sun.COM (4.1/SMI-4.1)
  15.     id AA26290; Sat, 18 Jan 92 11:53:27 PST
  16. Received: from prony.Colorado.EDU by boulder.Colorado.EDU with SMTP id AA04647
  17.   (5.65c/IDA-1.4.4 for <bug-gnuplot%pixar.uucp@sun.com>); Sat, 18 Jan 1992 12:53:25 -0700
  18. Received: by prony.Colorado.EDU (cu.generic.890828)
  19. From: Michael Clark <pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu>
  20. Message-Id: <9201181953.AA11256@prony.Colorado.EDU>
  21. Subject: gnuplot and eepic
  22. To: pixar!bug-gnuplot@ames.arc.nasa.gov
  23. Date: Sat, 18 Jan 92 12:53:26 MST
  24. Mailer: Elm [revision: 66.25]
  25. Status: RO
  26.  
  27. Dave,
  28.   I tried messing with the linetypes in eepic.trm but had problems with the
  29. spacing of the dots and dashes.  I gather this problem has be noted before.
  30. Therefore, I opted to use linespoints curves in my figures.  This led to
  31. a problem.  If I used many samples to describe the curve, the symbols were
  32. too closely spaced.  When I used fewer samples, the curves lost their 
  33. smoothness (as expected).  What I really needed was a way to plot every 
  34. n^th point so that I could get I smooth curve without tons of symbols.  So,
  35. I hacked to the code to do the following.
  36.  
  37. Instead of just having two params following the style param, there are now
  38. 4:
  39.  
  40. 1: line_type
  41. 2: point_type
  42. 3: point_skip   - gives the number of data samples per plotted point
  43. 4: point_offs   - gives the sample number on which to plot the first point
  44.  
  45. Thus points are plotted only for the samples n satisfying 
  46.         n = point_skip*i + point_offs 
  47. for some non-negative integer i.
  48.  
  49. This seems to have done the trick.  Thanks for your help.  Here are 
  50. the diffs if anyone else is interested.
  51.  
  52. --------------------------------------------------------------------------
  53.  
  54. *** command.c.old       Fri Jan 17 15:41:38 1992
  55. --- command.c   Sat Jan 18 12:47:04 1992
  56. ***************
  57. *** 178,185 ****
  58.                 if (c_token < num_tokens)       /* something after command */
  59.                         if (equals(c_token,";"))
  60.                                 c_token++;
  61. !                       else
  62. !                                       int_error("';' expected",c_token);
  63.         }
  64.   }
  65.   
  66. --- 178,185 ----
  67.                 if (c_token < num_tokens)       /* something after command */
  68.                         if (equals(c_token,";"))
  69.                                 c_token++;
  70. !                       else 
  71. !                                       int_error("';' expected",c_token); 
  72.         }
  73.   }
  74.   
  75. ***************
  76. *** 1302,1307 ****
  77. --- 1302,1309 ----
  78.                   printf("Plot title: '%s'\n", this_plot->title);
  79.                   printf("Line type %d\n", this_plot->line_type);
  80.                   printf("Point type %d\n", this_plot->point_type);
  81. +                 printf("Point skip %d\n", this_plot->point_skip);
  82. +                 printf("Point offset %d\n", this_plot->point_offs);
  83.                   printf("max points %d\n", this_plot->p_max);
  84.                   printf("current points %d\n", this_plot->p_count);
  85.                   printf("\n");
  86. ***************
  87. *** 1450,1455 ****
  88. --- 1452,1459 ----
  89.     
  90.                         this_plot->line_type = line_num;
  91.                         this_plot->point_type = point_num;
  92. +                       this_plot->point_skip = 1;
  93. +                       this_plot->point_offs = 1;
  94.   
  95.                         if (almost_equals(c_token,"w$ith")) {
  96.                                 if (parametric && xparam) 
  97. ***************
  98. *** 1466,1471 ****
  99. --- 1470,1483 ----
  100.                                 struct value t;
  101.                                 this_plot->point_type = (int)real(const_express(&t))-1;
  102.                         }
  103. +                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
  104. +                               struct value t;
  105. +                               this_plot->point_skip = (int)real(const_express(&t));
  106. +                       }
  107. +                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
  108. +                               struct value t;
  109. +                               this_plot->point_offs = (int)real(const_express(&t));
  110. +                       }
  111.                         if ( (this_plot->plot_style == POINTS) ||
  112.                                  (this_plot->plot_style == LINESPOINTS) ||
  113.                                  (this_plot->plot_style == ERRORBARS) )
  114. ***************
  115. *** 1638,1643 ****
  116. --- 1650,1663 ----
  117.                         }
  118.   
  119.                         /* line and point types were handled above */
  120. +                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
  121. +                               struct value t;
  122. +                               (void)real(const_express(&t));
  123. +                       }
  124. +                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
  125. +                               struct value t;
  126. +                               (void)real(const_express(&t));
  127. +                       }
  128.                         if ( !equals(c_token,",") && !END_OF_COMMAND ) {
  129.                                 struct value t;
  130.                                 (void)real(const_express(&t));
  131. *** graphics.c.old      Fri Jan 17 14:58:01 1992
  132. --- graphics.c  Fri Jan 17 16:01:02 1992
  133. ***************
  134. *** 815,821 ****
  135.       int x,y;
  136.       struct termentry *t = &term_tbl[term];
  137.   
  138. !     for (i = 0; i < plot->p_count; i++) {
  139.            if (plot->points[i].type == INRANGE) {
  140.                   x = map_x(plot->points[i].x);
  141.                   y = map_y(plot->points[i].y);
  142. --- 815,821 ----
  143.       int x,y;
  144.       struct termentry *t = &term_tbl[term];
  145.   
  146. !     for (i = plot->point_offs; i < plot->p_count; i=i+plot->point_skip) {
  147.            if (plot->points[i].type == INRANGE) {
  148.                   x = map_x(plot->points[i].x);
  149.                   y = map_y(plot->points[i].y);
  150. *** plot.h.old  Fri Jan 17 15:11:18 1992
  151. --- plot.h      Fri Jan 17 15:42:50 1992
  152. ***************
  153. *** 353,358 ****
  154. --- 353,360 ----
  155.         char *title;
  156.         int line_type;
  157.         int point_type;
  158. +       int point_skip;         /* plot only every skip^th point with linespoints */ 
  159. +       int point_offs;         /* start with linesp_offs^th point */
  160.         int p_max;                                      /* how many points are allocated */
  161.         int p_count;                                    /* count of points in points */
  162.         struct coordinate *points;
  163.  
  164. --
  165. Michael Clark
  166. University of Colorado                  Phone:  (303) 492-2759
  167. Campus Box 425                          Fax:    (303) 492-2758
  168. Boulder, CO 80309-0425
  169.  
  170.